import {
	request,
} from '@/api/request';
const apiList = [{
		name: 'schoollist',
		url: '/api/school/list',
		method: 'GET'
	},
	{
		name: 'schoolinfo',
		url: '/api/school/info',
		method: 'GET'
	},
	{
		// /api/school/add_collect
		name: 'add_collect',
		url: '/api/school/add_collect',
	},
	{
		// /api/comments/list
		name: 'commentslist',
		url: '/api/comments/list',
		method: 'GET'
	},
	{
		// /api/comments/like_list
		name: 'likelist',
		url: '/api/comments/like_list',
		method: 'GET'
	},
	{
		// /api/comments/add_comments
		name: 'add_comments',
		url: '/api/comments/add_comments',
	},
	{
		// /api/check/list
		name: 'checklist',
		url: '/api/check/list',
		method: 'GET'
	},
	{
		name: 'majorlist',
		url: '/api/school/major_list',
		method: 'GET'
	},
	{
		name: 'majortype',
		url: '/api/school/major_type',
		method: 'GET'
	} ,
	{
		name: 'majorinfo',
		url: '/api/school/major_info',
		method: 'GET'
	} 
	
]


module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data, token) => request({
		url: params.url,
		method: params.method || 'POST',
		data,
		token,
		showlod: params.showlod
	})
	return mode
}, {})